<?php


class PlayerTable extends Doctrine_Table
{
  public static function getInstance()
  {
    return Doctrine_Core::getTable('Player');
  }

  public function getOverviewQuery($order_by = 'name ASC')
  {
    $q = $this->createQuery('p')
      ->select('*, COUNT(name) AS gamecount')
      ->groupBy('name')
      ->orderBy($order_by);

    return $q;
  }
}
